package com.dq.demo.ui.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.dq.demo.util.ToastUtil;
import com.dq.wallpaper.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * CreateName : Z-JC
 * Date : 2019/10/18
 * Describe :
 */
public class FeedBackActivity extends BaseActivity {

    @BindView(R.id.img_back)
    public ImageView ivBack;
    @BindView(R.id.tv_title)
    public TextView tvTitle;
    @BindView(R.id.title)
    public RelativeLayout rlTitle;
    @BindView(R.id.ed_content)
    public EditText edContent;
    @BindView(R.id.btn_submit)
    public Button btnSubmit;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_feedback);
        ButterKnife.bind(this);
        initView();
    }

    public void initView() {
        rlTitle.setPadding(0, this.height, 0, 0);
        tvTitle.setText(getString(R.string.text_feedback));
    }

    @Override
    public void initData() {

    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    @OnClick({R.id.btn_submit, R.id.img_back})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.btn_submit:
                String content = edContent.getText().toString().trim();
                if (TextUtils.isEmpty(content)) {
                    ToastUtil.showShortToast(this, "反馈内容不能为空");
                    return;
                }
                ToastUtil.showShortToast(this, "提交成功");
                this.finish();
                break;
            case R.id.img_back:
                this.finish();
                break;
        }
    }
}